<?php

defined( '_JEXEC' ) or die( 'Restricted access' );

class HTML_transports
{
	function editTransports ($row, $lists, $option){
		$editor =& JFactory::getEditor();
?>
		<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
		<fieldset class="adminform">
			<legend>Details</legend>
			<table class="admintable">
				<tr>
					<td width="100" align="right" class="key">Nama</td>
					<td><input class="text_area" type="text" name="nama" id="nama" size="50" maxlength="100" value="<?php echo $row->nama ?>"></td>
				</tr>
				<tr>
					<td width="100" align="right" class="key">Jalur</td>
					<td><input class="text_area" type="text" name="jalur" id="kota" size="50" maxlength="100" value="<?php echo $row->jalur ?>"></td>
				</tr>
				<tr>
					<td width="100" align="right" class="key">Kota</td>
					<td><input class="text_area" type="text" name="kota" id="kota" size="50" maxlength="100" value="<?php echo $row->kota ?>"></td>
				</tr>
				<tr>
					<td width="100" align="right" class="key">Boleh Turun Di Sembarang Tempat</td>
					<td><?php echo $lists['status']; ?></td>
				</tr>
				<tr>
					<td width="100" align="right" class="key">Upload File</td>
					<td><input type="file" name="userfile" id="file"> File Saat ini <?php echo $row->path_file; ?> : . File Lama akan ditimpa</td>
				</tr>
			</table>
		</fieldset>
		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="id" value="<?php echo $row->id ; ?>" />
		<input type="hidden" name="task" value="" />
		</form>
	<?php 
			
	}
	function showTransports($option, $rows)
	{
	
	?>
<form action="index.php" method="post" name="adminForm">
<table class="adminlist">
<thead>
	<tr>
		<th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count($rows); ?>);" />
		<th>Nama</th>
		<th>Jalur</th>
		<th>Kota</th>
		<th>Nama_File</th>
		<th>Path File</th>
		<th>Keterangan</th>
	</tr>	
</thead>
<?php
	 jimport('joomla.filter.output');
	$k = 0;
	for($i=0, $n=count( $rows ); $i < $n; $i++)
	{
		$row = &$rows[$i];
		$checked = JHTML::_('grid.id', $i, $row->id);		
		 $link = JFilterOutput::ampReplace( 'index.php?option=' .$option. '&task=edit&cid[]='. $row->id );
?>
	<tr class="<?php echo "row$k"; ?>">
		<td><?php echo $checked; ?></td>
		<td><a href="<?php echo $link ?>"><?php echo $row->nama; ?></a></td>
		<td><?php echo $row->jalur; ?></td>
		<td><?php echo $row->kota; ?></td>
		<td><?php echo $row->nama_file; ?></td>
		<td><?php echo $row->path_file; ?></td>
		<td>
		<?php 
			if($row->status == '1')
				echo "Boleh Turun Dimana Saja";
			else
				echo "Tidak Boleh Turun Di Sembarang Tempat";		
		?>		
		</td>
	</tr>
	<?php $k = 1- $k; } ?>
</table>
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="id" value="<?php echo $row->id ; ?>" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
</form>
	<?php 
	}
}
?>